import 'package:flutter/material.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: Text('Flutter Demo')
        ),
        //body内容多抽离出去
        body: HomeContent()
      )
    );
  }
  
}

//body
class HomeContent extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return  ListView(
      padding: EdgeInsets.all(10),
      children: <Widget>[
        Image.network('https://www.itying.com/images/flutter/1.png'),
        Container(
          child: Text(
            '图片1',
            textAlign: TextAlign.center,
            style: TextStyle(
              fontSize: 28
            ),
          ),
          height: 60,
          padding: EdgeInsets.fromLTRB(0,10,0,10),
        ),

        Image.network('https://www.itying.com/images/flutter/2.png'),
        Container(
          child: Text(
            '图片2',
            textAlign: TextAlign.center,
            style: TextStyle(
              fontSize: 28
            ),
          ),
          height: 60,
          padding: EdgeInsets.fromLTRB(0,10,0,10),
        ),

        Image.network('https://www.itying.com/images/flutter/3.png'),
        Container(
          child: Text(
            '图片3',
            textAlign: TextAlign.center,
            style: TextStyle(
              fontSize: 28
            ),
          ),
          height: 60,
          padding: EdgeInsets.fromLTRB(0,10,0,10),
        ),

        Image.network('https://www.itying.com/images/flutter/4.png'),
        Container(
          child: Text(
            '图片4',
            textAlign: TextAlign.center,
            style: TextStyle(
              fontSize: 28
            ),
          ),
          height: 60,
          padding: EdgeInsets.fromLTRB(0,10,0,10),
        ),
      ],
    );
  }
  
}